Platform Explorer / Nuxeo Platform 2021.52

Component org.nuxeo.ecm.platform.MailService

Documentation

Services to to manage mails.

Resolution Order

418
The resolution order represents the order in which this component has been resolved by the Nuxeo Runtime framework.
You can influence this order by adding "require" tags in your component declaration, to make sure it is resolved after another component.

Start Order

851
The start order represents the order in which this component has been started by the Nuxeo Runtime framework.
This number is interesting to tweak if your Java component interacts with other components, and needs to be started before or after another one.
It can be changed by implementing the method "Component#getApplicationStartedOrder()" on your Java component: components are sorted according to this reference value, in increasing order.
The default value is 1000, and the repository initialization uses number 100. Negative values can also be used.

Implementation

Class: org.nuxeo.ecm.platform.mail.service.MailServiceImpl

Services

Extension Points

XML Source

<?xml version="1.0"?>
<component name="org.nuxeo.ecm.platform.MailService">
  <documentation>
    Services to to manage mails.

    @author <a href="mailto:arussel@nuxeo.com">Alexandre Russel</a>
  </documentation>
  <service>
    <provide interface="org.nuxeo.ecm.platform.mail.service.MailService" />
  </service>
  <implementation class="org.nuxeo.ecm.platform.mail.service.MailServiceImpl" />
  <extension-point name="sessionFactory">
    <documentation>
      Extension point to register a session factory.

      <p>
        A session factory allows to create session for users. To create sessions
        the factory needs informations such as host, port, protocol ... The list
        of needed properties depends on the protocol used and if you need store,
        transport or both. For more information see the
        <a href="http://java.sun.com/products/javamail/javadocs/index.html">
          JavaMail API
        </a>
        .
      </p>
      <p>
        To get hold of a Session call: MailService mailService =
        Framework.getService(MailSerivce.class); Transport transport =
        mailSerivce.getTransport("myFactory"); Store store =
        mailServcie.getStore("myFactory");
      </p>
      <p>
        The default is to get a session for the authenticated user if any, or
        you can pass a String to get a session for a user.
      </p>
    </documentation>
    <object
      class="org.nuxeo.ecm.platform.mail.service.SessionFactoryDescriptor" />
  </extension-point>
  <extension-point name="propertiesFetcher">
    <documentation>
      Extension point to register a properties fetcher.
      <p>
        The responsability of a property fetcher is to fetch properties from any
        backend.
      </p>
    </documentation>
    <object
      class="org.nuxeo.ecm.platform.mail.fetcher.PropertiesFetcherDescriptor" />
  </extension-point>

  <extension-point name="actionPipes">
    <documentation>
      Extension point to register a list of actions.

      <p>
        An ActionPipe is a list of ActionMessage used for mail import. Default contribution
        are merged but you can override them using 'override' attribute.

      <code>
        <pipe name="nxmail" override="true">
          <action id="StartAction" to="CreateDocumentsAction">
            org.nuxeo.ecm.platform.mail.listener.action.StartAction
          </action>
          <action id="CreateDocumentsAction">
            org.nuxeo.ecm.platform.mail.listener.action.CreateDocumentsAction
          </action>
        </pipe>
      </code>
      </p>

      <p>
        When registering the ActionPipe, the service looks for an ActionMessage named
        'StartAction', so this is a mandatory attribute. Registration of the pipe ends when
        service doesn't find the next action.
      </p>

      <p>
        Since 6.0, you can use Automation to control how Documents are created from email.
        For that you need to redefine the ActionPipe.
        <code>
         <pipe name="nxmail"  override="true">
          <action>
            org.nuxeo.ecm.platform.mail.listener.action.StartAction
          </action>
          <action>
            org.nuxeo.ecm.platform.mail.listener.action.ExtractMessageInformationAction
          </action>
          <action chain="CreateMailDocumentFromAutomation">
            org.nuxeo.ecm.platform.mail.listener.action.CreateDocumentsFromAutomationChainAction
          </action>
         </pipe>
        </code>

        Then the CreateMailDocumentFromAutomation Chain whill be used to create the content.
      </p>

    </documentation>
    <object
      class="org.nuxeo.ecm.platform.mail.action.MessageActionPipeDescriptor" />
  </extension-point>

</component>